<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>CssSelector_ (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
  </script>

  <script src="static/js/doc.js">
  </script>

  <meta charset="utf8">
</head>

<body onload="prettyPrint()">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">cssom.iframe.style.CssSelector_</span>
        <span>Extends</span>
        <span class="fn-name">
          <a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">
            Object</a>
        </span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Represents a single CSS selector, as described in
<a href="http://www.w3.org/TR/REC-CSS2/selector.html">http://www.w3.org/TR/REC-CSS2/selector.html</a>
Currently UNSUPPORTED are the following selector features:
<ul>
<li>pseudo-classes (:hover)
<li>child selectors (div &gt; h1)
<li>adjacent sibling selectors (div + h1)
<li>attribute selectors (input[type=submit])
</li></li></li></li></ul>
  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="closure_goog_cssom_iframe_style.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<pre class="inheritance">
Object
     <img src="static/images/inherit.gif">goog.cssom.iframe.style.CssSelector_
</pre>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.cssom.iframe.style.CssSelector_(<span><span class="arg">opt_selectorString</span></span>)
  </div>

   <h3>Parameters</h3>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">opt_selectorString</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">String containing selectors to parse.</div>
     </td>
   </tr>
  </table>


<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_cssom_iframe_style_CssSelector_.html">
              goog.cssom.iframe.style.CssSelector_
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.cssom.iframe.style.CssSelector_.prototype.matchElementAncestry"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">matchElementAncestry<span class="args">(<span class="arg">elementAncestry</span>)</span>
        </span>
        &#8658; <div class="fullType"><span>?</span><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span></div>
      </div>


     <div class="entryOverview">
       Tests to see what part of a DOM element hierarchy would be matched by
this selector, and returns the indexes of the matching element and matching
selector part.
<p>
For example, given this hierarchy:
document &gt; html &gt; body &gt; div.content &gt; div.sidebar &gt; p
and this CSS selector:
body div.sidebar h1
This would return {elementIndex: 4, selectorPartIndex: 1},
indicating that the element at index 4 matched
the css selector at index 1.
</p>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">elementAncestry</span>
        : <div class="fullType"><span class="type"><a href="class_goog_cssom_iframe_style_NodeAncestry_.html">goog.cssom.iframe.style.NodeAncestry_</a></span></div>
        <div class="entryOverview">Object representing an element and its ancestors.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span>?</span><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span></div>&nbsp;
            Object with the properties elementIndex and selectorPartIndex, or null if there was no match.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_cssom_iframe_style.js.source.html#line363">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.cssom.iframe.style.CssSelector_.prototype.setPartsFromString_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">setPartsFromString_<span class="args">(<span class="arg">selectorString</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Parses a selector string into individual parts.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">selectorString</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">A string containing a CSS selector.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_cssom_iframe_style.js.source.html#line329">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




















<div class="section">
  <table class="horiz-rule">


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package cssom</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="goog" current="cssom.iframe.style.CssSelector_"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
